Ext.define('Admin.view.menu.MenuAddForm', {
    extend: 'Ext.form.Panel',
    alias: 'widget.menuAddForm',
    requires: [
    ],

    viewModel: {type: 'menuViewModel'},
    controller: 'menuViewController',
    //cls: '',

    layout: {
        type:'vbox',
        align:'stretch'
    },

    bodyPadding: 10,
    scrollable: true,

    defaults: {
        labelWidth: 60,
        labelSeparator: ''
    },

    items: [{
        xtype: 'textfield',
        fieldLabel: '菜单名称',
        name:'text'
    }, {
        xtype: 'textfield',
        fieldLabel: '图标类型',
        name:'iconCls'
    },{
        xtype: 'textfield',
        fieldLabel: '视图链接',
        name:'viewType'
    },{
        xtype:'radiogroup',
        fieldLabel: '是否子节点',
        style: 'padding-top:3px;height:17px;',
        items: [{ name: 'leaf', inputValue: 'true', boxLabel: '是', checked: true }, 
        { name: 'leaf', inputValue: 'false', boxLabel: '否'}]
    },{
        xtype:'combobox',
    
        allowBlank: true,
        fieldLabel: '父节点',
        store:{
                proxy: {
                type: 'ajax',
                url:'tree/findFather',
                reader: {
                    type: 'json',
                    rootProperty: 'lists'
                }},
                fields: [ 'treeId', 'text']
            },displayField: 'text',
                        valueField: 'treeId',
                        name:'fatherId',
                        blankText: '请选择',
                        Addable: false,
                        mode: 'local' 
                }],

    bbar: {
        overflowHandler: 'menu',
        items: ['->',{
            xtype: 'button',
            ui: 'soft-green',
            text: '提交',
            handler : 'submitEditForm'
        },{
            xtype: 'button',
            ui: 'soft-red',
            text: '取消',
	        handler :function(bt){
	        	var win = bt.up('window');
		        if (win) {
		            win.close();
		        }
	        }
        },'->']
    }
});